namespace EIM_Accounting.BLL
{
    using System;
    using System.Data;
    using Accounting.DAL;
    using EIM_Accounting.Common.StringUtility;

    public class CP010106
    {
        private readonly Contract contract = new Contract();
        //private readonly ContractFee contractFee = new ContractFee();
        private readonly ContractMember contractMember = new ContractMember();
        private readonly Staff staff = new Staff();

        internal DataSet getContractList()
        {
            return contract.GetList("  FinishFlag='0' ");
        }

        internal string getContractInfobyId(string p)
        {
            string backStr = string.Empty;
            try
            {
                Accounting.Model.Contract model = contract.GetModel(int.Parse(p));

                backStr += "合约公司：" + model.SignComp + Environment.NewLine;
                backStr += "预订期间：" + StringHelper.getDateStrWithoutNewLine(model.PlanStartDate, model.PlanEndDate) + Environment.NewLine;
                backStr += "实际期间：" + StringHelper.getDateStrWithoutNewLine(model.RealStartDate, model.RealEndDate) + Environment.NewLine;
                backStr += "单金　　：" + StringHelper.getDecimalStr(model.SingleMoney) + Environment.NewLine;
                backStr += "总额　　：" + StringHelper.getDecimalStr(model.TotalMoney) + Environment.NewLine;
                backStr += Environment.NewLine;
                backStr += "备注　　：" + Environment.NewLine + model.Remark + Environment.NewLine;
            }
            catch
            {
            }
            return backStr;
        }

        internal void saveContractMember(Accounting.Model.ContractMember contractMemberModel)
        {
            contractMember.Add(contractMemberModel);
        }

        internal DataSet getMemberList()
        {
            //and (OutDate !=null or OutDate !='')
            return staff.GetList(" StaffType!='合作者' ");
        }
    }
}